package com.example.springtransaction.service;

import com.example.springtransaction.mapper.UserMapper;
import com.example.springtransaction.model.UserInfo;
import org.apache.catalina.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author : niu niu
 * @version : 1.0.0
 * @date : 2023/5/7 20:18
 */
@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;
    @Transactional(propagation = Propagation.NESTED)
     public Integer add(UserInfo userInfo){
        return userMapper.add(userInfo);
    }
}
